package com.zsrt.java.day20161226.wrl.day161226.homework;

public class ClassDg {
	public static void main(String[] args) {
		System.out.println(xx(10));
	}
	
	
	/**
	 * 递归：计算1+2+...+10
	 * @param number	最大值
	 * @return 和
	 */
	public static int xx(int number) {
		int sum = 0;
		if(number>0){
			return sum = sum + xx(number-1);
		}else{
			return 1;
		}
	}

}
